﻿Option Strict On
Option Explicit On

Imports System.Text
Imports EM.BaseApplication
Imports EM.System

Namespace DataClasses
    Public Class Company
        Inherits BaseData

        Public Sub New(ByVal SessionKey As SessionKey)
            MyBase.New(SessionKey)
        End Sub

        Public Property ID As Int64
        Public Property Code As String
        Public Property Name As String
        Public Property Description As String
        Public Property Phone As String
        Public Property Email As String
        Public Property Add1 As String
        Public Property Addr2 As String
        Public Property Addr3 As String
        Public Property City As String
        Public Property State As String
        Public Property Country As String   'TODO: May convert to an ENUM?
        Public Property Zip As String
        Public Property Active As Boolean

        Public Function Read(ByVal ID As Int64) As Boolean
            Dim SQL As New StringBuilder

            'TODO: Prepare select statement and assign to Properties.
        End Function

        Public Function Post() As Int64
            'TODO: Based on ID property prepare Insert/Update statement from Properties
            If ID > 0 Then

            Else

            End If

        End Function

        Private Function Validate() As Boolean
            'TODO: Put the validation logic in here.
            'For E.g. Country is a valid Contry code.

        End Function

    End Class
End Namespace

